package com.example.equipmentmanage

import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.example.equipmentmanage.databinding.ActivitySheDetailBinding
import com.example.equipmentmanage.utils.SheBeiViewModel
import com.example.lib_base.mvvm.BaseActivity
import dagger.hilt.android.AndroidEntryPoint

@Route(path = "/equipmentmanage/SheDetailActivity")
@AndroidEntryPoint
class SheDetailActivity : BaseActivity<ActivitySheDetailBinding,SheBeiViewModel>() {
    @Autowired
    @JvmField
    var id:Int = 1
    override fun initView() {
        ARouter.getInstance().inject(this)
        vm.SheDetail(id)
        binding.back.setOnClickListener {
            finish()
        }
    }

    override fun initData() {
        vm.SheDetailSuccess.observe(this){
            binding.tvProjectName.text="项目名称：${it.deviceName}"
            binding.tvAccessControl.text=it.deviceType
            binding.tvAccessControlLocation.text=it.installationLocation
        }
    }

}